Portfolio Learn Month 01 Kali Basics

🛠️ Day 8: Linux Services

Linux
Systemd

Services are the silent workers of your operating system. 👷‍♂️


🆚 Service vs. Process

A Service is essentially a process that runs in the background, often starting automatically at boot.

Feature Service 🛠️ Process 🏃
Start Automatic or Manual Manual (User)
Mode Background (Daemon) Foreground (mostly)
Lifespan Long-running Often short-lived
Example ssh, apache2 ls, cd, cat

Note: In Kali, systemd is the manager that controls these services.


🕹️ Essential Service Commands

Manage your services using systemctl.

1. Check Status

systemctl status ssh

Look for Active: active (running) to confirm it's working.

2. Start a Service

sudo systemctl start ssh

Starts the service immediately.

3. Stop a Service

sudo systemctl stop ssh

Stops the service immediately.

4. Enable at Boot

sudo systemctl enable ssh

Ensures the service starts automatically when you turn on the computer.

5. Disable at Boot

sudo systemctl disable ssh

Prevents the service from starting automatically.

6. Restart

sudo systemctl restart ssh

Stops and then starts the service (useful for applying config changes).

7. List Running Services

systemctl --type=service --state=running

⚠️ Why Services Matter?

Understanding services is critical for security: